

    $('#applyEdit').click(function(){

        layer.open({
            type: 1,
            skin: 'layui-layer-rim', //加上边框
            area: ['620px', '320px'], //宽高
            shadeClose: true, //开启遮罩关闭
            title: '申请修改活动',
            content:
            "<div class='tag_create_form'>"+
            "请发邮件到 Dannie@scool.cc"+
            "</div>"
        });
    })

    $('.offline').click(function(){

        id = $(this).attr('data-id');
        var index = layer.load(1, {
            shade: [0.1,'#fff'] //0.1透明度的白色背景
        });

        layer.confirm('下线活动', {
            btn: ['确定', '取消'] //可以无限个按钮
        }, function(index){

            $.post("/event/offline",
                {'id':id},
                function(result){
                    if(result.status == true){

                        $.successAlert(result.msg);

                        setTimeout(function (){window.location.reload()}, 3000)
                    }else{

                        $.errorAlert(result.msg);

                        return false;
                    }
                },"json");


            layer.closeAll('dialog');
        }, function(index){
            layer.closeAll()
        });

    })

    $('.online').click(function(){

        id = $(this).attr('data-id');
        var index = layer.load(1, {
            shade: [0.1,'#fff'] //0.1透明度的白色背景
        });


        layer.confirm('上线活动', {
            btn: ['确定', '取消'] //可以无限个按钮
        }, function(index){

            $.post("/event/online",
                {'id':id},
                function(result){
                    if(result.status == true){

                        $.successAlert(result.msg);

                        setTimeout(function (){window.location.reload()}, 3000)
                    }else{

                        $.errorAlert(result.msg);

                        return false;
                    }
                },"json");


            layer.closeAll('dialog');
        }, function(index){
            layer.closeAll()
        });

    })